import requests

url = 'https://fanyi.baidu.com/sug'

headers = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36'
}

data = {
    'kw': 'eye'
}

response = requests.post(url=url, data=data, headers=headers)

content = response.text

print(content)

import json

# 这里不需设置编码
# obj = json.loads(content,encoding='utf-8') 错误的写法
obj = json.loads(content)

print(obj)
